Repository navigation
own: a const declared from a merge of owning locals borrows them; a value moved into a field of an element read borrows that field (TSLANG 58, 59) - #851
Merged
Conversation
…erge made in a loop's body (TSLANG 58) `const selected = c ? tensor0 : tensor1` (native_ts_graphics core/directx_math.ts) was refused as merged from several branches. Each local keeps its value, so the const borrows each of them (slotLoadsOfMerge, decideSlot). takerLoops took a merge's own declaration as reached again around a loop before the merge is remade, which refused it in a loop's body, and TSLANG 54's fresh merge there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d, borrows that field (TSLANG 59) `const frame = this.frames[i]; frame.buf = buf; if (buf) ...` (native_ts_graphics examples/nri/procedural_geometry_nri.ts) was a use after a move: TSLANG 50/52 read the field back right after the move only through an object read out of a local or parameter. Right after the store nothing runs, so an object read out of an element or a field is the same object (objectReadableRightAfter). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
DefaultLib
Own skips one more than for #850: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TSLANG_ISSUES 58 and 59, found by compiling powder_sandbox's
-mm=ownbuild (native_ts_graphics as its submodule) with the compiler from main. Write-ups are inTSLANG_ISSUES.md.58: a
constdeclared from a merge of owning locals borrows themconst selected = x2py2gez2pw2 ? (x2gey2 ? tensor0 : tensor1) : (z2gew2 ? tensor2 : tensor3)(ntgcore/directx_math.ts) was refused: "merged from several branches; -mm=own cannot prove which one owns it yet". So was a plainconst s = c ? t0 : t1.let's retain of a merge whose ways in are each a read of an owning local, or null or undefined (slotLoadsOfMerge), is made a receiver of each of those locals.decideSlotthen takes the borrow path for them, so rc's retain and release for theconstgo, and each local's releases and assignments end the borrow.constis still used; theconststored, returned or assigned.takerLoopstook a merge's own declaration (its block's first op) as reached again around a loop before the merge is remade. That refused such a merge in a loop's body, and TSLANG 54'sconst p = c ? mk() : nullin a loop as well.directx_math.tscompiles under own. With its facts object built, so doescore/simple_camera.ts, which had been refused only for calling into a module with no facts.59: a value moved into a field of an element or field read, then used, borrows that field
const queuedFrame = this.queuedFrames[i]; ... queuedFrame.aabbAttributeBuffer = buffer; const view = buffer ? buffer.createStructuredView(0) : null;(ntgexamples/nri/procedural_geometry_nri.ts) was refused: "used here after its value was moved".constgiven an element is no local by then; it is the element read itself.objectReadableRightAfter). The checks then follow the borrow through that chain.procedural_geometry_nri.ts:425, which reduced copies of it do not reproduce.Effect on the sweep (276 sources, every facts object built)
core/modules that don't compile under own: 6 → 4. Left:donut_first_person_camera,nri_donut_textures,ray_tracing_extended_scene(needs@keeps/Shared<T>in ntg),rtxpt_game.tslang.execrashed (0xC0000005) oncore/ray_tracing_extended_scene.ts. It did not reproduce in about 45 more runs: alone, six at a time, and a full sweep rerun. Each of those gave its usual 5 errors.Tests
00tslang_issue_58.tsand00tslang_issue_59.ts, under every model, JIT and compiled.own_err_merged_locals_overwritten,own_err_merged_locals_movedandown_err_element_field_moved_replaced.tests.ps1for each model is running; results to follow in a comment.🤖 Generated with Claude Code